home *** CD-ROM | disk | FTP | other *** search
- This document describes the programming interface capabilities of DISK SPOOL
- II version 4.00. Please note the following definitions:
-
- ASCIIZ - This refers to a file spec (including drive and path) followed
- by a binary 0. The maximum length of the entire ASCIIZ
- (including the terminating 0) is 33 bytes.
-
- port involved - This refers to the Spool Port (i.e. - the port that DISK
- Spool II is intercepting and re-routing to disk).
-
- 1 - COM1
- 2 - COM2
- 5 - LPT1
- 6 - LPT2
-
- The reason that the "port involved" needs to be indicated
- in most of the function calls described below is that it
- is possible to load 2 or more copies of DISK SPOOL II into
- memory at the same time, thereby driving multiple printing
- devices simultaneously.
-
-
- Note that all program hooks are done via software interrupt calls. The
- interrupt number used is INT 1Ah. Thus, the program must first set AH as
- well as the other registers as indicated, and then do an INT 1Ah.
- -------------------------------------------------------------------------------
-
- 1. Enable the Spooling Function.
-
- Input:
- ah = 0e0h
- al = 1
- cl = port involved
- Return:
- ah = 0 ... if successful
- 0f0h if request failed because there is no copy of
- DISK SPOOL II in memory that is spooing the
- designated port.
- 0ffh if request failed for a miscellaneous reason
-
- 2. Disable the Spooling Function.
-
- Same as 1, above, except that al = 2 on input.
-
- 3. Enable the Despooling Function
-
- Same as 1, above, except that al = 3 on input.
-
- 4. Disable the Despooling Function
-
- Same as 1, above, except that al = 4.
-
- 5. DISK SPOOL II status call.
-
- Input:
- ah = 0e1h
- cl = port involved
- Return:
- ah = 0f0h ... no copy of DISK SPOOL II is currently in memory
- that is spooling the designated port.
- 0 ...... a copy of DISK SPOOL II is installed for the
- designated port; and furthermore:
-
- ES:BX ...... a far pointer to an ASCIIZ of the current
- Spool File (or in the case where the AutoSpool
- or the AutoDespool feature is enabled, an ASCIIZ
- of the next spool file.)
- ES:SI ...... a far pointer to an ASCIIZ of the current
- Despool file ... i.e. - the file currently being
- printed.
- cl = 0 ...... if the Despooler is disabled.
- 41h .... if the Despooler is enabled.
- ch = 0 ...... if the Spooler is disabled.
- 41h .... if the Spooler is enabled.
- dl = 0 ...... if the Despooler is standing by.
- 41h .... if the Despooler is currently printing.
- ES:DI ...... a far pointer to the 3-byte file extention
- being used by DISK SPOOL II. (e.g. - SPL)
-
- 6. Get 1st spool file. Based on the user-designated spool file directory,
- and the user-designated file extention, this function returns the ASCIIZ
- of the first file that exists. NOTE: this function is only meaningful if
- the AutoSpool or AutoDespool functions are enabled.
-
- Input:
- ah = 0e2h
- al = 1
- cl = port involved
-
- Return:
- ah = 0f0h if no files exist
- = 0ffh if function call failed.
- = 0 if function succeeded; and furthermore:
- ES:BX is returned as a far pointer to the ASCIIZ of
- this first file.
-
- 7. Get the next spool file. This function must always be proceeded by the
- function described just above, "get 1st spool file".
-
- Input:
- ah = 0e2h
- al = 2
-
- Return:
- ah = 0f0h if no more files exist
- = 0ffh if function failed
- = 0 if function succeeded; and furthermore:
- ES:BX is returned as a far pointer to the ASCIIZ of
- the file.
-
- 8. Obtain status about a spool file. NOTE: this function is generally used
- when AutoSpool or AutoDespool is enabled.
-
- Input:
- ah = 0e3h
- al = 1
- ES:BX points to the ASCIIZ of the file
- Return:
- ah = 0f0h if the file pointed to was not a DISK SPOOL II
- spooled file.
- = 0ffh if the function failed.
- = 0 if the function succeeded; and furthermore, ES:SI is
- returned as a far pointer to the following data
- structure:
-
- Length in Bytes Description
- --------------- ----------------------------------------------------------
- 1 Hour when file created, or last changed.
- 1 Minute when file created, or last changed.
- 1 Year when file created, or last changed. 0 = 1980,
- 1 = 1981, and so forth.
- 1 Month when file created, or last changed.
- 1 Day when file created, or last changed.
- 1 * Number of copies requested to print.
- 1 Number of copies already printed.
- 1 * Print port; 1 - COM1; 2 - COM2; 5 - LPT1; 6 - LPT2
- 1 * Save status; 1 - file will be saved after printing;
- 0 - file will be deleted after printing.
- 1 * File status:
- 1 - file finished printing, but being Saved.
- 2 - file held.
- 3 - file queued up for printing.
- 4 - file currently being spooled.
- 5 - file currently being despooled (i.e. - being
- printed)
- 16 * 15-byte description, followed by a binary 0. DISK
- SPOOL II generally places the name of the process
- invoked from DOS into this field. For example, if
- Lotus created the spool file, and the command that
- was used to load Lotus was 123, then the description
- would be 123. If SP2PRT is used to spool a previously
- existing DOS file, then the name of the file is placed
- into the description.
- 2 High order word of the file's size in bytes.
- 2 Low order word of the file's size in bytes.
- 2 High order word of the number of bytes left to print.
- 2 Low order word of the number of bytes left to print.
-
- 9. Update a spool file.
-
- Input:
- ah = 0e3h
- al = 2
- ES:BX points to the ASCIIZ of the file to update.
- ES:SI points to the same data structure as above. Only the
- fields marked with an '*' are updated; and the File Status
- byte may be set to a 2 in order to hold the file, and to a 3
- in order to release it.
- Return:
- ah = 0f0h if the file pointed to was not a DISK SPOOL II
- spooled file.
- 0ffh if the function request failed.
- 0 if the function request succeeded.
-
- NOTE: The most common way to effect an update to a spool file is to perform
- an "obtain status about a spool file" first (8., above); after which
- point ES:BX and ES:SI are set correctly, and you need only modify
- those fields that you wish to update. Then issue this function call.
-
- 10. Spool a file. This function is used when an already existing DOS file
- needs to be printed.
-
- Input:
- ah = 0e4h
- al = 1
- ES:BX points to an ASCIIZ of the file to be spooled.
- cl = port involved
- Return:
- ah = 0ffh if function failed.
- = 0 if function succeeded.
-
- -------------------------------------------------------------------------------
-
- The following is an example of how the above function calls could be used to
- designate the number of copies to be printed. This example assumes that
- the AutoSpool or the AutoDespool function is enabled.
-
- 1. Perform a DISK SPOOL II status call (5., above). ES:BX will be returned
- as a far pointer to an ASCIIZ of the next spool file. Copy the 33 bytes
- pointed to into your own save area. NOTE: Even though the name of
- the next spool file is known, the file will not yet have actually been
- created. Therefore, there is no point in doing a status call or a file
- update yet. If you want the file that is going to be created to be on
- hold so that it doesn't get processed by the Despooler until you release it,
- then create an SP2.DAT record so indicating. (Refer to the User's Guide
- for instructions on how SP2.DAT functions.)
-
- 2. Run your application.
-
- 3. Perform an "obtain status about a spool file" function (8., above). Point
- ES:BX to the 33 bytes save area that you created in step 1.
-
- 4. Perform the "update a spool file" function (9., above), changing the number
- of copies.
-